package App.OO.service.thread.Manage;

import App.OO.service.thread.CtoSThread;

import java.util.HashMap;

//管理客户端连接服务器端的线程
public class ManageCtoSThread {
    //key:用户ID
    private static HashMap<String, CtoSThread> manage = new HashMap<>();

    public static void addCtoSThread(String userId, CtoSThread ctoSThread) {
        manage.put(userId, ctoSThread);
    }

    public static CtoSThread getCtoSThread(String userId) {
        return manage.get(userId);
    }

    public static void deleteCtoSThread(String userId) {
        manage.remove(userId);
    }
}
